package com.ruoyi.workorder.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.file.ImageUtils;
import com.ruoyi.workorder.domain.WorkOrder;
import org.apache.ibatis.annotations.Param;

/**
 * 工单Mapper接口
 * 
 * @author renyuxin
 * @date 2024-05-28
 */
public interface WorkOrderMapper 
{
    /**
     * 查询工单
     * 
     * @param woId 工单主键
     * @return 工单
     */
    public WorkOrder selectWorkOrderByWoId(Long woId);

    /**
     * 查询工单列表
     * 
     * @param workOrder 工单
     * @return 工单集合
     */
    public List<WorkOrder> selectWorkOrderList(WorkOrder workOrder);

    /**
     * 新增工单
     * 
     * @param workOrder 工单
     * @return 结果
     */
    public int insertWorkOrder(WorkOrder workOrder);

    /**
     * 修改工单
     * 
     * @param workOrder 工单
     * @return 结果
     */
    public int updateWorkOrder(WorkOrder workOrder);

    /**
     * 删除工单
     * 
     * @param woId 工单主键
     * @return 结果
     */
    public int deleteWorkOrderByWoId(Long woId);

    /**
     * 批量删除工单
     * 
     * @param woIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWorkOrderByWoIds(Long[] woIds);

    List<String> hasRelated(Long woCatalogId);

    List<WorkOrder> selectWorkOrderListForUser(@Param("workOrder") WorkOrder workOrder, @Param("userId") Long userId);


    Long checkNameUnique(WorkOrder workOrder);


    String findMaxWoNumberToday(String todayDate);

    List<Map<String, Object>> selectListProblemStatistics(Long projectId);
}
